Skip to content

feat(env): adding env var commands to cli - #90

Open
Ryank90 wants to merge 2 commits into
rc/serverlessfrom
feat/runserv-551
Open

feat(env): adding env var commands to cli#90
Ryank90 wants to merge 2 commits into
rc/serverlessfrom
feat/runserv-551

Conversation

@Ryank90

@Ryank90 Ryank90 commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

No description provided.

@coderabbitai

coderabbitai Bot commented Aug 18, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. To trigger a review, include coderabbit-review in the PR description. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 04c3ffb1-09c4-46e7-ae98-c65fb42ebb2f

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds support for managing plain-text deployment environment variables in the Serverless CLI, including API client methods, CLI commands, display formatting, and generated documentation.

Changes:

  • Introduces serverless apps env with list, set, and unset subcommands (including --value / --value-file handling).
  • Adds Serverless API client support for listing/updating/deleting deployment environment variables, plus tests.
  • Extends serverless display/table helpers to render env-var outputs (including created/updated timestamps) and updates docs.

Reviewed changes

Copilot reviewed 15 out of 15 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
internal/cmd/serverless/value.go New shared helper to read values from --value / --value-file / stdin with newline trimming.
internal/cmd/serverless/value_test.go Unit tests for readValueFlag behavior (flag/file/stdin/error).
internal/cmd/serverless/secrets.go Reuses shared readValueFlag and removes duplicated secret value-reading helper.
internal/cmd/serverless/secrets_test.go Removes tests tied to the deleted readSecretValue helper.
internal/cmd/serverless/display.go Adds env-var display result types and new table columns (Key/Value/Created/Updated).
internal/cmd/serverless/display_test.go Tests env-var display rows/headers and unset result shape.
internal/cmd/serverless/apps.go Registers the new apps env command group.
internal/cmd/serverless/apps_env.go Implements serverless apps env {list,set,unset} commands and flag wiring.
internal/api/serverless/env.go Adds API client methods for env-var list/update/delete endpoints.
internal/api/serverless/env_test.go Adds API client tests for env-var list/update/delete and error cases.
docs/runware_serverless_apps.md Adds apps env to the serverless apps command docs.
docs/runware_serverless_apps_env.md New generated docs for runware serverless apps env.
docs/runware_serverless_apps_env_list.md New generated docs for apps env list.
docs/runware_serverless_apps_env_set.md New generated docs for apps env set.
docs/runware_serverless_apps_env_unset.md New generated docs for apps env unset.
Suppressed comments (1)

internal/api/serverless/env.go:77

  • This debug log records the full response body, which includes plaintext environment variable values on success. To reduce the chance of leaking sensitive data into logs, prefer logging only metadata (e.g., status/path) and body length, or redact value fields.
	if c.logger != nil && c.logger.Enabled(ctx, slog.LevelDebug) {
		c.logger.Debug("serverless response", //nolint:errcheck,gosec
			"path", "/v1/deployments/"+deploymentID+"/environment-variables/"+key,
			"status", resp.StatusCode(),
			"body", string(resp.Body),
		)

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread internal/api/serverless/env.go
Comment thread docs/runware_serverless_apps_env_set.md Outdated
Comment thread internal/cmd/serverless/apps_env.go Outdated

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 15 out of 15 changed files in this pull request and generated no new comments.

Suppressed comments (1)

internal/cmd/serverless/secrets.go:116

  • When setting a secret, errors from readValueFlag will say "read value from ..." (stdin/file). This is a user-facing message and is less clear in the context of serverless secrets set. Wrapping the error here makes it explicit that the failure occurred while reading the secret value.
			secretValue, err := readValueFlag(value, valueFile, cmd.InOrStdin())
			if err != nil {
				return err
			}

@Ryank90
Ryank90 marked this pull request as ready for review August 18, 2026 20:07
Base automatically changed from feat/runserv-544 to rc/serverless August 18, 2026 20:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants